Hello, I would like to create a label like a link to a folder or url in a DB, but I can not find any help about it. Can someone help me? Example: When i click on the label the folder that contain the url that i associated to it opened.
Thanks Gandara - Thu Jul 23 11:30:18 EDT 2015 |
Re: Label as a link DOORS does not natively support hyperlinks with a different label inside the Object Text. However in RTF you can do. It seems at least in DOORS 9.4 you can do the following in DXL:
string s = "{\\rtf1\\ansi{\\field{\\*\\fldinst HYPERLINK \"https://www.duckduckgo.com/\"}{\\fldrslt Click me}}}"
Object o = current
o."Object Text" = richText s
This will put a clickable hyperlink in the object text of the current object. You can probably make a tool, that will put a certain richtext in the clipboard for the user or a script to paste it to the current object:
string s = "{\\rtf1\\ansi{\\field{\\*\\fldinst HYPERLINK \"https://www.duckduckgo.com/\"}{\\fldrslt Click me}}}"
setRichClip richText s
After executing this, you can paste it when you edit the object. You can also make a GUI that will ask the user for Label and Hyperlink and copy it to the clipboard or something. DOORS does not support hyperlinks with a label on its own. However certain exporters support special syntaxes to export those hyperlinks correctly. Hope this helps, regards Mathias
|
Re: Label as a link Mathias Mamsch - Thu Jul 23 16:48:33 EDT 2015 DOORS does not natively support hyperlinks with a different label inside the Object Text. However in RTF you can do. It seems at least in DOORS 9.4 you can do the following in DXL:
string s = "{\\rtf1\\ansi{\\field{\\*\\fldinst HYPERLINK \"https://www.duckduckgo.com/\"}{\\fldrslt Click me}}}"
Object o = current
o."Object Text" = richText s
This will put a clickable hyperlink in the object text of the current object. You can probably make a tool, that will put a certain richtext in the clipboard for the user or a script to paste it to the current object:
string s = "{\\rtf1\\ansi{\\field{\\*\\fldinst HYPERLINK \"https://www.duckduckgo.com/\"}{\\fldrslt Click me}}}"
setRichClip richText s
After executing this, you can paste it when you edit the object. You can also make a GUI that will ask the user for Label and Hyperlink and copy it to the clipboard or something. DOORS does not support hyperlinks with a label on its own. However certain exporters support special syntaxes to export those hyperlinks correctly. Hope this helps, regards Mathias
Hello Mathias,
Thanks for your reply, but i´m talking about a label into a Dialog Box, not into any object text. (Check Attachments image.)
Thanks for your support. |
Re: Label as a link Hi There exists a html-DBE. May be that this control helps, but I do not have any experience with it. Best regards Wolfgang |
Re: Label as a link Wolfgang Uhr - Fri Jul 24 04:28:28 EDT 2015 Hi There exists a html-DBE. May be that this control helps, but I do not have any experience with it. Best regards Wolfgang Hello Wolfgang,
I find some example, but not exactly as label.
Thanks
string str = "www.google.es"
DB splitBox = create "Text splitter" show splitBox |
Re: Label as a link Don't try to make DOORS something it is not. DOORS has no clickable labels inside dialogs. You should use a button instead. Regards, Mathias |
Re: Label as a link You can try to play with canvas ;)
// globals ------------------------
DB mainDB = null
DBE cnv = null
DBE fld = null
DBE btn = null
string newURL = "www.google.fr"
// mecanics -----------------------
void doClose(DB x){ hide x; destroy x }
void doRepaint(DBE cnv){
if ( newURL == "" ) return
int cnvWidth = width cnv
int y = 0
int x = 0
realBackground(cnv, realColor_NewGrey2)
realColor(cnv, realColor_Blue)
font(cnv, 9, HeadingsFont)
y = (height(cnv)/2) + (height(cnv, newURL)/2) - 3
x = cnvWidth - width(cnv, newURL) - 3
draw(cnv, x, y-1, newURL)
line(cnv, x, y, x+width(cnv, newURL), y)
}
void doPressButton(DBE x){
newURL = get(fld)
if ( newURL == "" ) return
doRepaint(cnv)
}
void doClic(DBE cnv, int but, bool ctrl, int x, int y) {
if (x > (width(cnv) - width(cnv, newURL) - 3)) activateURL(newURL)
}
void left( DBE x, DBE y ){ x->"top"->"aligned"->y; x->"left"->"spaced"->y }
void line( DBE x[] ){ int n = sizeof x; int i; for i in 1:n-1 do left ( x[i], x[i-1] ) }
// instance ----------------------
mainDB = create "Do what you want in DXL"
fld = field( mainDB, "", "", 60 )
btn = button( mainDB, "set new URL", doPressButton )
// align the field and the button
line(fld, btn)
cnv = canvas( mainDB, 0, 32, doRepaint)
// add the canvas behind ? ;)
cnv->"top"->"form"
close(mainDB, false, doClose)
set(cnv, doClic)
realize(mainDB){ setSize(mainDB, 700, 75) }
show mainDB
(thx to Master Goodman and his website www.smartDXL.com !) |